﻿using System;
using System.Text.RegularExpressions;
using JetBrains.Annotations;

namespace WikiDoc.Lines
{
    /// <summary>
    /// 表示一个注释行
    /// </summary>
    public class CommentLine : WikiLine
    {
        /// <summary>
        /// 初始化 <see cref="IndentLine"/> 类的新实例.
        /// </summary>
        /// <param name="line">The line.</param>
        protected CommentLine(string line)
            : base(line, LineTypes.Comment)
        {
        }

        [CanBeNull]
        public static WikiLine TryParse(string line)
        {
            if (string.IsNullOrEmpty(line)) return null;

            return line.StartsWith("##")
                       ? new CommentLine(line)
                       : null;
        }
    }
}
